package com.roc.steelend.controller;


import com.roc.steelend.controller.vo.returnformat.ReturnMsgForTable;
import com.roc.steelend.pojo.GroupClient;
import com.roc.steelend.service.GroupClientService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@Api(tags = "客户组功能接口")
public class GroupClientController {

    @Autowired
    private GroupClientService groupClientService;


    @GetMapping("/v1/groupClient/showAll")
    @ApiOperation(value = "展示所有客户组分类",notes = "不需要值")
    public List<GroupClient> findAllGroupClient(){


       return groupClientService.findAllGroupClient();
    }


    @GetMapping("/v1/groupClient/show")
    @ApiOperation(value = "展示客户组分类",notes = "可以传一个selectMsg")
    public ReturnMsgForTable findGroupClient(@RequestParam(value = "selectMsg",required = false)@ApiParam(value = "查询信息",required = false)String selectMsg,
                                             @RequestParam(value = "now",required = true)Integer now,
                                             @RequestParam(value = "size",required = true)Integer size){



        return groupClientService.findGroupClient(selectMsg,now,size);
    }
}
